/**
 * Copyright (C) 2015-2018 IQIYI
 * All rights reserved.
 *
 * AUTHOR(S)
 * 王海斌
 *   E-mail: wanghaibin@qiyi.com
 * 
 * VERSION
 *   Fri 20 Jul 2018 02:33:33 PM CST
 */

#include <string.h>
#include <stdio.h>
#include <string>
#include <list>

using namespace std;

int main(int argc, char *argv[])
{
    std::list<std::string> mylist;
    for(int i=0; i<1; ++i ) {
        char buf[32]={0};
        sprintf(buf, "%d", i);
        mylist.push_back(buf);
    }

    printf("first data=%s, size=%d\n", mylist.front().c_str(), mylist.size());
    mylist.pop_front();
    printf("first data=%s, size=%d, empty=%d\n\n\n", mylist.front().c_str(), mylist.size(), mylist.empty());
    std::list<std::string>::iterator it = mylist.begin();
    for(;it!= mylist.end(); ++it) {
        printf("first data=%s, size=%d\n", (*it).c_str(), mylist.size());
    }

    return 0;
}
